//
//  main.cpp
//  L16String
//
//  Created by ai-nixs on 2017/10/29.
//  Copyright © 2017年 nixinsheng. All rights reserved.
//

#include <iostream>
#include <string>
using namespace std;

#include <sstream>

int main(int argc, const char * argv[]) {
    string str="Hello,";
    ///<>有重载运算符+=
    str+="倪新生.";
    str+="男.";
    cout<<str<<endl;
    
    
    //字符串连接其他类型；
    stringstream ss;
    //重载运算符<<
    ss<<"Hello,";
    ss<<200;
    ss<<",  ";
    ss<<"2.5,";
    ss<<"HELLO,"<<"JKXY"<<-100;
    cout<<ss.str()<<endl;//ss.str() 访问str的C++字符串
    cout<<ss.str().c_str()<<endl;//ss.str().c_str() 访问str的C语言字符串
    
    
    
    return 0;
}
